10 COMMON NAM$(),PLAYER(),CURRENT,PEOPLE,PRMTXT,SECTXT,TRITXT
15 PM=PRMTXT:SC=SECTXT:TI=TRITXT  'z=dealto,z1=card,z2$=ans$,z3()=dscrd(),z4()=z4()
20 IF TI=0 THEN BG=2:FORTXT=16 ELSE IF TI=7 THEN BG=2:FORTXT=31 ELSE BG=0:FORTXT=31
30 COLOR PM,BG,BG:CLS
40 TRUE=1:FALSE=0
50 DIM DECK(52),DCD(5),PCD(5),CRD(5),Z3(3)
60 DIM Z4(5),DSCD(3),HICRD(2),CVL(5),TIEP(5),TIED(5)
70 CVL(1)=1:CVL(2)=7:CVL(3)=13:CVL(4)=19:CVL(5)=25:PFOLD=FALSE:DFOLD=FALSE
80 GOSUB 8380
90 COLOR SC,BG
100 DEF SEG=&H40:RANDOMIZE PEEK(&H6D)*256!+PEEK(&H6C)-32768!
110 GOSUB 1670
120 LOCATE 10,1:COLOR BG:PRINT SPACE$(40):LOCATE 11,1:PRINT SPACE$(40)
130 LOCATE 23,7:COLOR PM:PRINT "Pres. Esc p/regresar al menu."
140 IF PLAYER(CURRENT)<30 THEN 270
150 LOCATE 10,7:COLOR SC:PRINT NAM$(CURRENT)", el minimo es 10$,      "
160 LOCATE 11,7:PRINT "   desea jugar      (S/N)?    ";
170 LOCATE 11,34:COLOR TI:PRINT "    ";:LOCATE 11,34,1
180 Z2$=INKEY$:IF Z2$<>"" THEN 180
190 Z2$=INKEY$:IF Z2$=""  THEN 190
200 IF Z2$="s" OR Z2$="S" THEN PRINT Z2$:GOTO 390
210 IF Z2$=CHR$(27) THEN LOCATE ,,0:PRINT "Esc": CHAIN"rstart",420
220 IF Z2$<>"N" AND Z2$<>"n" THEN SOUND 400,4:GOTO 180
230 LOCATE ,,0:PRINT Z2$:IF PEOPLE=1 THEN CHAIN"rstart",420
240 CURRENT=CURRENT+1:IF CURRENT>PEOPLE THEN CURRENT=1
250 COLOR BG:FOR I=10 TO 11:LOCATE I,1:PRINT SPACE$(40);:NEXT
260 IF PLAYER(CURRENT)>=30 THEN GOSUB 8380:GOTO 150
270 LOCATE 15,7:COLOR SC:PRINT NAM$(CURRENT)", necesita al menos"
280 LOCATE 16,7:PRINT "30$ para jugar poker."
290 LOCATE 18,7,0:PRINT " Quiere probar con":LOCATE 19,7,1:PRINT "  otro juego (S/N)? ";
300 Z2$=INKEY$:IF Z2$<>"" THEN 300
310 Z2$=INKEY$:IF Z2$="" THEN 310
320 IF Z2$="s" OR Z2$="S" THEN COLOR TI:PRINT Z2$;:CHAIN"rstart",420
330 IF Z2$=CHR$(27) THEN COLOR TI:PRINT "Esc";:CHAIN"rstart",420
340 IF Z2$<>"N" AND Z2$<>"n" THEN SOUND 400,4:GOTO 310
350 COLOR TI:PRINT Z2$;
360 IF PEOPLE=1 THEN CHAIN"start",420
370 GOSUB 8590:LOCATE 18,1:PRINT SPACE$(40);:LOCATE 19,1:PRINT SPACE$(40)
380 GOTO 240
390 LOCATE 10,1:COLOR BG:PRINT SPACE$(40):LOCATE 11,1:PRINT SPACE$(40):GOSUB 8570
400 LOCATE 4,5:COLOR SC:PRINT "CARTAS DE LA BANCA"
410 LOCATE 14,1:COLOR SC:PRINT STRING$(40,240)
420 BET=10
430 AMO=20:GOSUB 7760:PLAYER(CURRENT)=PLAYER(CURRENT)-10:GOSUB 8380
440 CDN=0
450 NP=0
460 ND=0
470 ROW=16:COL=1:COLP=1:COLD=1
480 Z=1
490 CDN=CDN+1
500 IF Z=1 THEN NP=NP+1:PCD(NP)=DECK(CDN):ROW=16 ELSE ND=ND+1:ROW=7:DCD(ND)=DECK(CDN)
510 Z1=DECK(CDN)
520 IF Z=0 THEN GOSUB 1570:GOTO 530 ELSE GOSUB 1860
530 IF ND=0 THEN Z=0:GOTO 490
540 IF NP=1 THEN Z=1:COL=COLP+6:COLP=COL:COLD=COL:GOTO 490
550 IF ND=1 THEN Z=0:GOTO 490
560 IF NP=2 THEN Z=1:COL=COLP+6:COLP=COL:COLD=COL:GOTO 490
570 IF ND=2 THEN Z=0:GOTO 490
580 IF NP=3 THEN Z=1:COL=COLP+6:COLP=COL:COLD=COL:GOTO 490
590 IF ND=3 THEN Z=0:GOTO 490
600 IF NP=4 THEN Z=1:COL=COLP+6:COLP=COL:COLD=COL:GOTO 490
610 IF ND=4 THEN Z=0:GOTO 490
620 IF NP=5 AND ND=5 THEN Z=1
630 IF Z=0 GOTO 1010
640 GOSUB 8570:GOSUB 8550
650 GOSUB 8530
660 LOCATE 23,1:COLOR SC,BG
670 PRINT NAM$(CURRENT)", apueste (Placa de 10$ min:";
680 LOCATE 24,1:PRINT "tipee M para min,F p/pasar)? ";
690 LOCATE 24,32:COLOR TI:PRINT "        ";:LOCATE 24,32,1:GOSUB 7430
700 IF STARTOVER=1 THEN 690
710 BET2=NUM
720 IF RID=1 THEN TOTLD=1:TOTLP=0:GOTO 1380
730 IF BET2<10 THEN LOCATE 25,3,0:COLOR TI:SOUND 400,4:PRINT NAM$(CURRENT)", 10$es la apuesta minima. ";:FOR I=1 TO 3000:NEXT:GOSUB 8530:GOTO 690
740 IF BET2>PLAYER(CURRENT) THEN LOCATE 25,3,0:COLOR TI:SOUND 400,4:PRINT NAM$(CURRENT)", ud solo tiene $";:VALU=PLAYER(CURRENT):GOSUB 8500:PRINT A$".";:FOR I=1 TO 3000:NEXT:GOSUB 8530:GOTO 690
750 IF PLAYER(CURRENT)-BET2>=10 THEN 780
760 GOSUB 9060
770 GOTO 640
780 BET=BET+BET2
790 AMO=AMO+BET2:GOSUB 7760:PLAYER(CURRENT)=PLAYER(CURRENT)-BET2:GOSUB 8380
800 GOSUB 8570:GOSUB 8550
810 FOR I=1 TO 5:CRD(I)=DCD(I):NEXT
820 CT=0:GOSUB 2160
830 GOTO 8890
840 IF F1=3 THEN F1=0:GOTO 860 ELSE F1=F1+1
850 LOCATE 6,12,0:COLOR TI:PRINT "NO VEO":TOTLP=1:TOTLD=0:BET=10:PLAYER(CURRENT)=PLAYER(CURRENT)+BET2:GOTO 1390
860 LOCATE 6,7,0:COLOR TI:PRINT " VEO SU APUESTA  ":AMO=AMO+BET2:GOSUB 7760
870 FOR I=1 TO 3000:NEXT
880 LOCATE 6,1:COLOR BALGRD:PRINT SPACE$(40)
890 COLOR SC:LOCATE 23,1:PRINT "Cuales cartas desea cambiar        ";
900 LOCATE 24,1:PRINT "(3 max., pres. "+CHR$(17)+CHR$(196)+CHR$(217)+"=Servido)? ";
910 LOCATE 24,32:COLOR TI:PRINT "       ";:LOCATE 24,32,1
920 GOSUB 7780
930 ROW=16
940 ON MANY+1 GOTO 1010,950,960,980
950 CDN=CDN+1:PCD(C)=DECK(CDN):Z1=PCD(C):COL=CVL(C):GOSUB 1860:GOTO 1010
960 CDN=CDN+1:PCD(C)=DECK(CDN):Z1=PCD(C):COL=CVL(C):GOSUB 1860
970 CDN=CDN+1:PCD(C2)=DECK(CDN):Z1=PCD(C2):COL=CVL(C2):GOSUB 1860:GOTO 1010
980 CDN=CDN+1:PCD(C)=DECK(CDN):Z1=PCD(C):COL=CVL(C):GOSUB 1860
990 CDN=CDN+1:PCD(C2)=DECK(CDN):Z1=PCD(C2):COL=CVL(C2):GOSUB 1860
1000 CDN=CDN+1:PCD(C3)=DECK(CDN):Z1=PCD(C3):COL=CVL(C3):GOSUB 1860
1010 GOSUB 5900
1020 CNT=0
1030 FOR I=1 TO 3
1040 IF DSCD(I)=0 THEN GOTO 1060
1050 CDN=CDN+1:DCD(DSCD(I))=DECK(CDN):CNT=CNT+1
1060 NEXT
1070 LOCATE 6,7:COLOR TI
1080 IF CNT=1 THEN PRINT "Yo cambio 1 carta.":GOTO 1110
1090 IF CNT=0 THEN PRINT "Yo no cambio cartas.":GOTO 1110
1100 PRINT "Yo cambio ";:VALU=CNT:GOSUB 8500:PRINT A$" cartas."
1110 DFOLD=FALSE:PFOLD=FALSE
1120 GOSUB 7000
1130 IF DFOLD=TRUE THEN TOTLP=1:TOTLD=0:GOTO 1380
1140 IF PFOLD=TRUE THEN TOTLP=0:TOTLD=1:GOTO 1380
1150 ROW=7:COL=1
1160 FOR I=1 TO 5
1170 Z1=DCD(I)
1180 GOSUB 1860
1190 COL=COL+6
1200 NEXT
1210 CT=0
1220 FOR I=1 TO 5
1230 CRD(I)=PCD(I)
1240 NEXT
1250 GOSUB 2160
1260 TOTLP=CT
1270 COLOR TI:HAND=TOTLP:X=19
1280 LOCATE 18,31,0:PRINT " Ud tiene";:GOSUB 8190
1290 CT=0
1300 FOR I=1 TO 5
1310 CRD(I)=DCD(I)
1320 NEXT
1330 GOSUB 2160
1340 TOTLD=CT
1350 COLOR TI:HAND=TOTLD:X=10
1360 LOCATE 9,31,0:PRINT "Yo tengo";:GOSUB 8190
1370 IF TOTLD=TOTLP THEN GOSUB 8070
1380 IF TOTLD>TOTLP THEN LOCATE 14,13,0:COLOR FORTXT:PRINT "YO GANO":PLAY "MBL25O5CO4BAGFEDCO3BAGFEDC"
1390 IF TOTLD<TOTLP THEN PLAYER(CURRENT)=PLAYER(CURRENT)+BET*2:COLOR FORTXT:LOCATE 25,12,0:PRINT "UD GANA";:PLAY "MBL25O3CDEFGABO4CDEFGABO5C"
1400 IF TOTLD=TOTLP THEN PLAYER(CURRENT)=PLAYER(CURRENT)+BET:LOCATE 14,13,0:COLOR FORTXT:PRINT "EMPATE";:PLAY "MBL32O3AAAAAAAAAAAAAAAA"
1410 FOR X=1 TO 4000:NEXT
1420 IF TOTLD<=TOTLP THEN GOSUB 8380
1430 COLOR BG
1440 FOR I=4 TO 23
1450 LOCATE I,1:PRINT SPACE$(40);
1460 NEXT
1470 GOSUB 8550:GOSUB 8530
1480 IF PLAYER(CURRENT)<=0 THEN CHAIN"Rstart",1060
1490 IF PLAYER(CURRENT)>=1000000! THEN CHAIN"Rstart",1105
1500 FOR I=1 TO 5
1510 DCD(I)=0:PCD(I)=0
1520 NEXT
1530 TOTLP=0:TOTLD=0:PFOLD=FALSE:DFOLD=FALSE
1540 IF CDN>42 THEN GOSUB 1670
1550 CURRENT=CURRENT+1:IF CURRENT>PEOPLE THEN CURRENT=1
1560 GOSUB 8380:GOTO 110
1570 COLOR 1,7:LOCATE ROW,COL:PRINT CHR$(201)+STRING$(3,203)+CHR$(187)
1580 FOR I=1 TO 5
1590 LOCATE ROW+I,COL:PRINT CHR$(204)+STRING$(3,206)+CHR$(185)
1600 NEXT
1610 LOCATE ROW+6,COL:PRINT CHR$(200)+STRING$(3,202)+CHR$(188)
1620 PLAY "L64O1D-":COLOR 4,BG
1630 RETURN
1640 PLAY "MBL50T255O1CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40CP40"
1650 PLAY "MBP10O0DP4DP4DP4DP1"
1660 RETURN
1670 LOCATE 13,17:COLOR PM:PRINT "POKER"
1680 LOCATE 15,7:PRINT "Por favor espere un segundo"
1690 LOCATE 16,7:PRINT "mientras mezclo las cartas."
1700 FOR I=1 TO 52
1710 DECK(I)=0
1720 NEXT
1730 GOSUB 1640
1740 FOR I=1 TO 52
1750 Z1=INT(RND*52)+1
1760 IF DECK(Z1)<>0 GOTO 1750
1770 DECK(Z1)=I
1780 IF I=48 THEN GOSUB 1640
1790 NEXT
1800 FOR I=1 TO 52
1810 IF DECK(I)=0 THEN 1700
1820 NEXT
1830 GOSUB 8590
1840 LOCATE 13,17:PRINT "     "
1850 RETURN
1860 COLOR 1,7:LOCATE ROW,COL,0:PRINT CHR$(201)+STRING$(3,205)+CHR$(187)
1870 FOR C=ROW+1 TO ROW+5
1880 LOCATE C,COL,0:PRINT CHR$(186)+SPACE$(3)+CHR$(186)
1890 NEXT
1900 LOCATE ROW+6,COL,0:PRINT CHR$(200)+STRING$(3,205)+CHR$(188)
1910 IF PM=7 THEN CL2=0 ELSE CL2=4
1920 IF Z1<14 THEN LOCATE ROW+1,COL+1,0:COLOR 0,7:PRINT CHR$(6):LOCATE ROW+5,COL+3,0:PRINT CHR$(6)
1930 IF (Z1>13) AND (Z1<27) THEN LOCATE ROW+1,COL+1,0:COLOR CL2,7:PRINT CHR$(3):LOCATE ROW+5,COL+3,0:PRINT CHR$(3)
1940 IF (Z1>26) AND (Z1<40) THEN LOCATE ROW+1,COL+1,0:COLOR 0,7:PRINT CHR$(5):LOCATE ROW+5,COL+3,0:PRINT CHR$(5)
1950 IF Z1>39 THEN LOCATE ROW+1,COL+1,0:COLOR CL2,7:PRINT CHR$(4):LOCATE ROW+5,COL+3,0:PRINT CHR$(4)
1960 IF PM=10 THEN COLOR 0:GOTO 1980
1970 IF PM= 7 THEN COLOR 0
1980 LOCATE ROW+3,COL+1,0
1990 IF (Z1=11) OR (Z1=24) OR (Z1=37) OR (Z1=50) THEN PRINT " J ":GOTO 2120
2000 IF (Z1=12) OR (Z1=25) OR (Z1=38) OR (Z1=51) THEN PRINT " Q ":GOTO 2120
2010 IF (Z1=13) OR (Z1=26) OR (Z1=39) OR (Z1=52) THEN PRINT " K ":GOTO 2120
2020 IF (Z1=1) OR (Z1=14) OR (Z1=27) OR (Z1=40) THEN PRINT " A " :GOTO 2120
2030 IF (Z1=2) OR (Z1=15) OR (Z1=28) OR (Z1=41) THEN PRINT " 2 " :GOTO 2120
2040 IF (Z1=3) OR (Z1=16) OR (Z1=29) OR (Z1=42) THEN PRINT " 3 " :GOTO 2120
2050 IF (Z1=4) OR (Z1=17) OR (Z1=30) OR (Z1=43) THEN PRINT " 4 " :GOTO 2120
2060 IF (Z1=5) OR (Z1=18) OR (Z1=31) OR (Z1=44) THEN PRINT " 5 " :GOTO 2120
2070 IF (Z1=6) OR (Z1=19) OR (Z1=32) OR (Z1=45) THEN PRINT " 6 " :GOTO 2120
2080 IF (Z1=7) OR (Z1=20) OR (Z1=33) OR (Z1=46) THEN PRINT " 7 " :GOTO 2120
2090 IF (Z1=8) OR (Z1=21) OR (Z1=34) OR (Z1=47) THEN PRINT " 8 " :GOTO 2120
2100 IF (Z1=9) OR (Z1=22) OR (Z1=35) OR (Z1=48) THEN PRINT " 9 " :GOTO 2120
2110 IF (Z1=10) OR (Z1=23) OR (Z1=36) OR (Z1=49) THEN PRINT " 10"
2120 PLAY "L64O1D-"
2130 IF Z=1 AND NP=1 THEN LOCATE 15,3,0:COLOR SC,BG:PRINT CHR$(49)+SPACE$(5)+CHR$(50)+SPACE$(5)+CHR$(51)+SPACE$(5)+CHR$(52)+SPACE$(5)+CHR$(53);
2140 COLOR SC,BG
2150 RETURN
2160 FLUSH=FALSE
2170 IF CRD(1)<14 AND CRD(2)<14 AND CRD(3)<14 AND CRD(4)<14 AND CRD(5)<14 THEN FLUSH=TRUE:GOTO 2220
2180 IF (CRD(1)>13 AND CRD(1)<27) AND (CRD(2)>13 AND CRD(2)<27) AND (CRD(3)>13 AND CRD(3)<27) AND (CRD(4)>13 AND CRD(4)<27) AND (CRD(5)>13 AND CRD(5)<27) THEN FLUSH=TRUE:GOTO 2220
2190 IF (CRD(1)>26 AND CRD(1)<40) AND (CRD(2)>26 AND CRD(2)<40) AND (CRD(3)>26 AND CRD(3)<40) AND (CRD(4)>26 AND CRD(4)<40) AND (CRD(5)>26 AND CRD(5)<40) THEN FLUSH=TRUE:GOTO 2220
2200 IF CRD(1)>39 AND CRD(2)>39 AND CRD(3)>39 AND CRD(4)>39 AND CRD(5)>39 THEN FLUSH=TRUE:GOTO 2220
2210 FLUSH=FALSE
2220 GOSUB 5490
2230 IF AC=1 AND KI=1 AND QU=1 AND JA=1 AND TE=1 THEN CT=125:GOTO 2340
2240 IF KI=1 AND QU=1 AND JA=1 AND TE=1 AND NI=1 THEN CT=124:GOTO 2340
2250 IF QU=1 AND JA=1 AND TE=1 AND NI=1 AND EI=1 THEN CT=123:GOTO 2340
2260 IF JA=1 AND TE=1 AND NI=1 AND EI=1 AND SE=1 THEN CT=122:GOTO 2340
2270 IF TE=1 AND NI=1 AND EI=1 AND SE=1 AND SI=1 THEN CT=121:GOTO 2340
2280 IF NI=1 AND EI=1 AND SE=1 AND SI=1 AND FI=1 THEN CT=120:GOTO 2340
2290 IF EI=1 AND SE=1 AND SI=1 AND FI=1 AND FO=1 THEN CT=119:GOTO 2340
2300 IF SE=1 AND SI=1 AND FI=1 AND FO=1 AND TH=1 THEN CT=118:GOTO 2340
2310 IF SI=1 AND FI=1 AND FO=1 AND TH=1 AND TW=1 THEN CT=117:GOTO 2340
2320 IF FI=1 AND FO=1 AND TH=1 AND TW=1 AND AC=1 THEN CT=116.5:GOTO 2340
2330 GOTO 2360
2340 IF FLUSH=TRUE THEN CT=CT+179
2350 RETURN
2360 IF AC=4 THEN CT=295:RETURN
2370 IF KI=4 THEN CT=294:RETURN
2380 IF QU=4 THEN CT=293:RETURN
2390 IF JA=4 THEN CT=292:RETURN
2400 IF TE=4 THEN CT=291:RETURN
2410 IF NI=4 THEN CT=290:RETURN
2420 IF EI=4 THEN CT=289:RETURN
2430 IF SE=4 THEN CT=288:RETURN
2440 IF SI=4 THEN CT=287:RETURN
2450 IF FI=4 THEN CT=286:RETURN
2460 IF FO=4 THEN CT=285:RETURN
2470 IF TH=4 THEN CT=284:RETURN
2480 IF TW=4 THEN CT=283:RETURN
2490 IF AC<>3 THEN GOTO 2630
2500 IF KI=2 THEN CT=282:RETURN
2510 IF QU=2 THEN CT=281:RETURN
2520 IF JA=2 THEN CT=280:RETURN
2530 IF TE=2 THEN CT=279:RETURN
2540 IF NI=2 THEN CT=278:RETURN
2550 IF EI=2 THEN CT=277:RETURN
2560 IF SE=2 THEN CT=276:RETURN
2570 IF SI=2 THEN CT=275:RETURN
2580 IF FI=2 THEN CT=274:RETURN
2590 IF FO=2 THEN CT=273:RETURN
2600 IF TH=2 THEN CT=272:RETURN
2610 IF TW=2 THEN CT=271:RETURN
2620 CT=116:RETURN
2630 IF KI<>3 THEN GOTO 2770
2640 IF AC=2 THEN CT=270:RETURN
2650 IF QU=2 THEN CT=269:RETURN
2660 IF JA=2 THEN CT=268:RETURN
2670 IF TE=2 THEN CT=267:RETURN
2680 IF NI=2 THEN CT=266:RETURN
2690 IF EI=2 THEN CT=265:RETURN
2700 IF SE=2 THEN CT=264:RETURN
2710 IF SI=2 THEN CT=263:RETURN
2720 IF FI=2 THEN CT=262:RETURN
2730 IF FO=2 THEN CT=261:RETURN
2740 IF TH=2 THEN CT=260:RETURN
2750 IF TW=2 THEN CT=259:RETURN
2760 CT=115:RETURN
2770 IF QU<>3 THEN GOTO 2910
2780 IF AC=2 THEN CT=258:RETURN
2790 IF KI=2 THEN CT=257:RETURN
2800 IF JA=2 THEN CT=256:RETURN
2810 IF TE=2 THEN CT=255:RETURN
2820 IF NI=2 THEN CT=254:RETURN
2830 IF EI=2 THEN CT=253:RETURN
2840 IF SE=2 THEN CT=252:RETURN
2850 IF SI=2 THEN CT=251:RETURN
2860 IF FI=2 THEN CT=250:RETURN
2870 IF FO=2 THEN CT=249:RETURN
2880 IF TH=2 THEN CT=248:RETURN
2890 IF TW=2 THEN CT=247:RETURN
2900 CT=114:RETURN
2910 IF JA<>3 THEN GOTO 3050
2920 IF AC=2 THEN CT=246:RETURN
2930 IF KI=2 THEN CT=245:RETURN
2940 IF QU=2 THEN CT=244:RETURN
2950 IF TE=2 THEN CT=243:RETURN
2960 IF NI=2 THEN CT=242:RETURN
2970 IF EI=2 THEN CT=241:RETURN
2980 IF SE=2 THEN CT=240:RETURN
2990 IF SI=2 THEN CT=239:RETURN
3000 IF FI=2 THEN CT=238:RETURN
3010 IF FO=2 THEN CT=237:RETURN
3020 IF TH=2 THEN CT=236:RETURN
3030 IF TW=2 THEN CT=235:RETURN
3040 CT=113:RETURN
3050 IF TE<>3 THEN GOTO 3190
3060 IF AC=2 THEN CT=234:RETURN
3070 IF KI=2 THEN CT=233:RETURN
3080 IF QU=2 THEN CT=232:RETURN
3090 IF JA=2 THEN CT=231:RETURN
3100 IF NI=2 THEN CT=230:RETURN
3110 IF EI=2 THEN CT=229:RETURN
3120 IF SE=2 THEN CT=228:RETURN
3130 IF SI=2 THEN CT=227:RETURN
3140 IF FI=2 THEN CT=226:RETURN
3150 IF FO=2 THEN CT=225:RETURN
3160 IF TH=2 THEN CT=224:RETURN
3170 IF TW=2 THEN CT=223:RETURN
3180 CT=112:RETURN
3190 IF NI<>3 THEN GOTO 3330
3200 IF AC=2 THEN CT=222:RETURN
3210 IF KI=2 THEN CT=221:RETURN
3220 IF QU=2 THEN CT=220:RETURN
3230 IF JA=2 THEN CT=219:RETURN
3240 IF TE=2 THEN CT=218:RETURN
3250 IF EI=2 THEN CT=217:RETURN
3260 IF SE=2 THEN CT=216:RETURN
3270 IF SI=2 THEN CT=215:RETURN
3280 IF FI=2 THEN CT=214:RETURN
3290 IF FO=2 THEN CT=213:RETURN
3300 IF TH=2 THEN CT=212:RETURN
3310 IF TW=2 THEN CT=211:RETURN
3320 CT=111:RETURN
3330 IF EI<>3 THEN GOTO 3470
3340 IF AC=2 THEN CT=210:RETURN
3350 IF KI=2 THEN CT=209:RETURN
3360 IF QU=2 THEN CT=208:RETURN
3370 IF JA=2 THEN CT=207:RETURN
3380 IF TE=2 THEN CT=206:RETURN
3390 IF NI=2 THEN CT=205:RETURN
3400 IF SE=2 THEN CT=204:RETURN
3410 IF SI=2 THEN CT=203:RETURN
3420 IF FI=2 THEN CT=202:RETURN
3430 IF FO=2 THEN CT=201:RETURN
3440 IF TH=2 THEN CT=200:RETURN
3450 IF TW=2 THEN CT=199:RETURN
3460 CT=110:RETURN
3470 IF SE<>3 THEN GOTO 3610
3480 IF AC=2 THEN CT=198:RETURN
3490 IF KI=2 THEN CT=197:RETURN
3500 IF QU=2 THEN CT=196:RETURN
3510 IF JA=2 THEN CT=195:RETURN
3520 IF TE=2 THEN CT=194:RETURN
3530 IF NI=2 THEN CT=193:RETURN
3540 IF EI=2 THEN CT=192:RETURN
3550 IF SI=2 THEN CT=191:RETURN
3560 IF FI=2 THEN CT=190:RETURN
3570 IF FO=2 THEN CT=189:RETURN
3580 IF TH=2 THEN CT=188:RETURN
3590 IF TW=2 THEN CT=187:RETURN
3600 CT=109:RETURN
3610 IF SI<>3 THEN GOTO 3750
3620 IF AC=2 THEN CT=186:RETURN
3630 IF KI=2 THEN CT=185:RETURN
3640 IF QU=2 THEN CT=184:RETURN
3650 IF JA=2 THEN CT=183:RETURN
3660 IF TE=2 THEN CT=182:RETURN
3670 IF NI=2 THEN CT=181:RETURN
3680 IF EI=2 THEN CT=180:RETURN
3690 IF SE=2 THEN CT=179:RETURN
3700 IF SI=2 THEN CT=178:RETURN
3710 IF FO=2 THEN CT=177:RETURN
3720 IF TH=2 THEN CT=176:RETURN
3730 IF TW=2 THEN CT=175:RETURN
3740 CT=108:RETURN
3750 IF FI<>3 THEN GOTO 3890
3760 IF AC=2 THEN CT=174:RETURN
3770 IF KI=2 THEN CT=173:RETURN
3780 IF QU=2 THEN CT=172:RETURN
3790 IF JA=2 THEN CT=171:RETURN
3800 IF TE=2 THEN CT=170:RETURN
3810 IF NI=2 THEN CT=169:RETURN
3820 IF EI=2 THEN CT=168:RETURN
3830 IF SE=2 THEN CT=167:RETURN
3840 IF SI=2 THEN CT=166:RETURN
3850 IF FO=2 THEN CT=165:RETURN
3860 IF TH=2 THEN CT=164:RETURN
3870 IF TW=2 THEN CT=163:RETURN
3880 CT=107:RETURN
3890 IF FO<>3 THEN GOTO 4030
3900 IF AC=2 THEN CT=162:RETURN
3910 IF KI=2 THEN CT=161:RETURN
3920 IF QU=2 THEN CT=160:RETURN
3930 IF JA=2 THEN CT=159:RETURN
3940 IF TE=2 THEN CT=158:RETURN
3950 IF NI=2 THEN CT=157:RETURN
3960 IF EI=2 THEN CT=156:RETURN
3970 IF SE=2 THEN CT=155:RETURN
3980 IF SI=2 THEN CT=154:RETURN
3990 IF FI=2 THEN CT=153:RETURN
4000 IF TH=2 THEN CT=152:RETURN
4010 IF TW=2 THEN CT=151:RETURN
4020 CT=106:RETURN
4030 IF TH<>3 THEN GOTO 4170
4040 IF AC=2 THEN CT=150:RETURN
4050 IF KI=2 THEN CT=149:RETURN
4060 IF QU=2 THEN CT=148:RETURN
4070 IF JA=2 THEN CT=147:RETURN
4080 IF TE=2 THEN CT=146:RETURN
4090 IF NI=2 THEN CT=145:RETURN
4100 IF EI=2 THEN CT=144:RETURN
4110 IF SE=2 THEN CT=143:RETURN
4120 IF SI=2 THEN CT=142:RETURN
4130 IF FI=2 THEN CT=141:RETURN
4140 IF FO=2 THEN CT=140:RETURN
4150 IF TW=2 THEN CT=139:RETURN
4160 CT=105:RETURN
4170 IF TW<>3 THEN GOTO 4310
4180 IF AC=2 THEN CT=138:RETURN
4190 IF KI=2 THEN CT=137:RETURN
4200 IF QU=2 THEN CT=136:RETURN
4210 IF JA=2 THEN CT=135:RETURN
4220 IF TE=2 THEN CT=134:RETURN
4230 IF NI=2 THEN CT=133:RETURN
4240 IF EI=2 THEN CT=132:RETURN
4250 IF SE=2 THEN CT=131:RETURN
4260 IF SI=2 THEN CT=130:RETURN
4270 IF FI=2 THEN CT=129:RETURN
4280 IF FO=2 THEN CT=128:RETURN
4290 IF TH=2 THEN CT=127:RETURN
4300 CT=104:RETURN
4310 IF FLUSH=TRUE THEN CT=126:RETURN
4320 IF AC<>2 THEN GOTO 4460
4330 IF KI=2 THEN CT=103:RETURN
4340 IF QU=2 THEN CT=102:RETURN
4350 IF JA=2 THEN CT=101:RETURN
4360 IF TE=2 THEN CT=100:RETURN
4370 IF NI=2 THEN CT=99:RETURN
4380 IF EI=2 THEN CT=98:RETURN
4390 IF SE=2 THEN CT=97:RETURN
4400 IF SI=2 THEN CT=96:RETURN
4410 IF FI=2 THEN CT=95:RETURN
4420 IF FO=2 THEN CT=94:RETURN
4430 IF TH=2 THEN CT=93:RETURN
4440 IF TW=2 THEN CT=92:RETURN
4450 CT=25:RETURN
4460 IF KI<>2 THEN GOTO 4590
4470 IF QU=2 THEN CT=91:RETURN
4480 IF JA=2 THEN CT=90:RETURN
4490 IF TE=2 THEN CT=89:RETURN
4500 IF NI=2 THEN CT=88:RETURN
4510 IF EI=2 THEN CT=87:RETURN
4520 IF SE=2 THEN CT=86:RETURN
4530 IF SI=2 THEN CT=85:RETURN
4540 IF FI=2 THEN CT=84:RETURN
4550 IF FO=2 THEN CT=83:RETURN
4560 IF TH=2 THEN CT=82:RETURN
4570 IF TW=2 THEN CT=81:RETURN
4580 CT=24:RETURN
4590 IF QU<>2 THEN GOTO 4710
4600 IF JA=2 THEN CT=80:RETURN
4610 IF TE=2 THEN CT=79:RETURN
4620 IF NI=2 THEN CT=78:RETURN
4630 IF EI=2 THEN CT=77:RETURN
4640 IF SE=2 THEN CT=76:RETURN
4650 IF SI=2 THEN CT=75:RETURN
4660 IF FI=2 THEN CT=74:RETURN
4670 IF FO=2 THEN CT=73:RETURN
4680 IF TH=2 THEN CT=72:RETURN
4690 IF TW=2 THEN CT=71:RETURN
4700 CT=23:RETURN
4710 IF JA<>2 THEN GOTO 4820
4720 IF TE=2 THEN CT=70:RETURN
4730 IF NI=2 THEN CT=69:RETURN
4740 IF EI=2 THEN CT=68:RETURN
4750 IF SE=2 THEN CT=67:RETURN
4760 IF SI=2 THEN CT=66:RETURN
4770 IF FI=2 THEN CT=65:RETURN
4780 IF FO=2 THEN CT=64:RETURN
4790 IF TH=2 THEN CT=63:RETURN
4800 IF TW=2 THEN CT=62:RETURN
4810 CT=22:RETURN
4820 IF TE<>2 THEN GOTO 4920
4830 IF NI=2 THEN CT=61:RETURN
4840 IF EI=2 THEN CT=60:RETURN
4850 IF SE=2 THEN CT=59:RETURN
4860 IF SI=2 THEN CT=58:RETURN
4870 IF FI=2 THEN CT=57:RETURN
4880 IF FO=2 THEN CT=56:RETURN
4890 IF TH=2 THEN CT=55:RETURN
4900 IF TW=2 THEN CT=54:RETURN
4910 CT=21:RETURN
4920 IF NI<>2 THEN GOTO 5010
4930 IF EI=2 THEN CT=53:RETURN
4940 IF SE=2 THEN CT=52:RETURN
4950 IF SI=2 THEN CT=51:RETURN
4960 IF FI=2 THEN CT=50:RETURN
4970 IF FO=2 THEN CT=49:RETURN
4980 IF TH=2 THEN CT=48:RETURN
4990 IF TW=2 THEN CT=47:RETURN
5000 CT=20:RETURN
5010 IF EI<>2 THEN GOTO 5090
5020 IF SE=2 THEN CT=46:RETURN
5030 IF SI=2 THEN CT=45:RETURN
5040 IF FI=2 THEN CT=44:RETURN
5050 IF FO=2 THEN CT=43:RETURN
5060 IF TH=2 THEN CT=42:RETURN
5070 IF TW=2 THEN CT=41:RETURN
5080 CT=19:RETURN
5090 IF SE<>2 THEN GOTO 5160
5100 IF SI=2 THEN CT=40:RETURN
5110 IF FI=2 THEN CT=39:RETURN
5120 IF FO=2 THEN CT=38:RETURN
5130 IF TH=2 THEN CT=37:RETURN
5140 IF TW=2 THEN CT=36:RETURN
5150 CT=18:RETURN
5160 IF SI<>2 THEN GOTO 5220
5170 IF FI=2 THEN CT=35:RETURN
5180 IF FO=2 THEN CT=34:RETURN
5190 IF TH=2 THEN CT=33:RETURN
5200 IF TW=2 THEN CT=32:RETURN
5210 CT=17:RETURN
5220 IF FI<>2 THEN GOTO 5270
5230 IF FO=2 THEN CT=31:RETURN
5240 IF TH=2 THEN CT=30:RETURN
5250 IF TW=2 THEN CT=29:RETURN
5260 CT=16:RETURN
5270 IF FO<>2 THEN GOTO 5310
5280 IF TH=2 THEN CT=28:RETURN
5290 IF TW=2 THEN CT=27:RETURN
5300 CT=15:RETURN
5310 IF TH<>2 THEN GOTO 5340
5320 IF TW=2 THEN CT=26:RETURN
5330 CT=14:RETURN
5340 IF TW=2 THEN CT=13:RETURN
5350 IF AC=1 THEN CT=12:RETURN
5360 IF KI=1 THEN CT=11:RETURN
5370 IF QU=1 THEN CT=10:RETURN
5380 IF JA=1 THEN CT=9:RETURN
5390 IF TE=1 THEN CT=8:RETURN
5400 IF NI=1 THEN CT=7:RETURN
5410 IF EI=1 THEN CT=6:RETURN
5420 IF SE=1 THEN CT=5:RETURN
5430 IF SI=1 THEN CT=4:RETURN
5440 IF FI=1 THEN CT=3:RETURN
5450 IF FO=1 THEN CT=2:RETURN
5460 IF TH=1 THEN CT=1:RETURN
5470 CT=.5
5480 RETURN
5490 AC=0:KI=0:QU=0:JA=0:TE=0:NI=0:EI=0:SE=0:SI=0:FI=0:FO=0:TH=0:TW=0
5500 FOR I=1 TO 5
5510 IF (CRD(I)=1 OR CRD(I)=14 OR CRD(I)=27 OR CRD(I)=40) THEN AC=AC+1:IF TOTLP<>0 THEN TIED(I)=14 ELSE TIEP(I)=14
5520 IF (CRD(I)=13 OR CRD(I)=26 OR CRD(I)=39 OR CRD(I)=52) THEN KI=KI+1:IF TOTLP<>0 THEN TIED(I)=13 ELSE TIEP(I)=13
5530 IF (CRD(I)=12 OR CRD(I)=25 OR CRD(I)=38 OR CRD(I)=51) THEN QU=QU+1:IF TOTLP<>0 THEN TIED(I)=12 ELSE TIEP(I)=12
5540 IF (CRD(I)=11 OR CRD(I)=24 OR CRD(I)=37 OR CRD(I)=50) THEN JA=JA+1:IF TOTLP<>0 THEN TIED(I)=11 ELSE TIEP(I)=11
5550 IF (CRD(I)=10 OR CRD(I)=23 OR CRD(I)=36 OR CRD(I)=49) THEN TE=TE+1:IF TOTLP<>0 THEN TIED(I)=10 ELSE TIEP(I)=10
5560 IF (CRD(I)=9 OR CRD(I)=22 OR CRD(I)=35 OR CRD(I)=48) THEN NI=NI+1:IF TOTLP<>0 THEN TIED(I)=9 ELSE TIEP(I)=9
5570 IF (CRD(I)=8 OR CRD(I)=21 OR CRD(I)=34 OR CRD(I)=47) THEN EI=EI+1:IF TOTLP<>0 THEN TIED(I)=8 ELSE TIEP(I)=8
5580 IF (CRD(I)=7 OR CRD(I)=20 OR CRD(I)=33 OR CRD(I)=46) THEN SE=SE+1:IF TOTLP<>0 THEN TIED(I)=7 ELSE TIEP(I)=7
5590 IF (CRD(I)=6 OR CRD(I)=19 OR CRD(I)=32 OR CRD(I)=45) THEN SI=SI+1:IF TOTLP<>0 THEN TIED(I)=6 ELSE TIEP(I)=6
5600 IF (CRD(I)=5 OR CRD(I)=18 OR CRD(I)=31 OR CRD(I)=44) THEN FI=FI+1:IF TOTLP<>0 THEN TIED(I)=5 ELSE TIEP(I)=5
5610 IF (CRD(I)=4 OR CRD(I)=17 OR CRD(I)=30 OR CRD(I)=43) THEN FO=FO+1:IF TOTLP<>0 THEN TIED(I)=4 ELSE TIEP(I)=4
5620 IF (CRD(I)=3 OR CRD(I)=16 OR CRD(I)=29 OR CRD(I)=42) THEN TH=TH+1:IF TOTLP<>0 THEN TIED(I)=3 ELSE TIEP(I)=3
5630 IF (CRD(I)=2 OR CRD(I)=15 OR CRD(I)=28 OR CRD(I)=41) THEN TW=TW+1:IF TOTLP<>0 THEN TIED(I)=2 ELSE TIEP(I)=2
5640 NEXT
5650 IF TOTLP=0 THEN 5780
5660 FOR J=2 TO 5
5670 K=TIED(J):I=J-1
5680 WHILE I>0 AND TIED(I)<K
5690 TIED(I+1)=TIED(I):I=I-1
5700 WEND
5710 TIED(I+1)=K
5720 NEXT
5730 IF TIED(1)=TIED(2) THEN IF TIED(4)=TIED(5) THEN SWAP TIED(3),TIED(5):GOTO 5890 ELSE GOTO 5890
5740 IF TIED(2)=TIED(3) THEN SWAP TIED(1),TIED(3)
5750 IF TIED(3)=TIED(4) THEN SWAP TIED(1),TIED(3):SWAP TIED(2),TIED(4)
5760 IF TIED(4)=TIED(5) THEN SWAP TIED(1),TIED(3):SWAP TIED(1),TIED(5):SWAP TIED(2),TIED(4)
5770 RETURN
5780 FOR J=2 TO 5
5790 K=TIEP(J):I=J-1
5800 WHILE I>0 AND TIEP(I)<K
5810 TIEP(I+1)=TIEP(I):I=I-1
5820 WEND
5830 TIEP(I+1)=K
5840 NEXT
5850 IF TIEP(1)=TIEP(2) THEN IF TIEP(4)=TIEP(5) THEN SWAP TIEP(3),TIEP(5):GOTO 5890 ELSE GOTO 5890
5860 IF TIEP(2)=TIEP(3) THEN SWAP TIEP(1),TIEP(3)
5870 IF TIEP(3)=TIEP(4) THEN SWAP TIEP(1),TIEP(3):SWAP TIEP(2),TIEP(4)
5880 IF TIEP(4)=TIEP(5) THEN SWAP TIEP(1),TIEP(3):SWAP TIEP(1),TIEP(5):SWAP TIEP(2),TIEP(4)
5890 RETURN
5900 FOR I=1 TO 5
5910 CRD(I)=DCD(I)
5920 NEXT
5930 GOSUB 7590
5940 PAIR=FALSE:J=1
5950 FOR JKJK=1 TO 5:Z4(JKJK)=0:NEXT:FOR JKJK=1 TO 3:DSCD(JKJK)=0:NEXT
5960 IF AC>1 THEN C=1:GOSUB 6110:PAIR=TRUE
5970 IF KI>1 THEN C=13:GOSUB 6110:PAIR=TRUE
5980 IF QU>1 THEN C=12:GOSUB 6110:PAIR=TRUE
5990 IF JA>1 THEN C=11:GOSUB 6110:PAIR=TRUE
6000 IF TE>1 THEN C=10:GOSUB 6110:PAIR=TRUE
6010 IF NI>1 THEN C=9:GOSUB 6110:PAIR=TRUE
6020 IF EI>1 THEN C=8:GOSUB 6110:PAIR=TRUE
6030 IF SE>1 THEN C=7:GOSUB 6110:PAIR=TRUE
6040 IF SI>1 THEN C=6:GOSUB 6110:PAIR=TRUE
6050 IF FI>1 THEN C=5:GOSUB 6110:PAIR=TRUE
6060 IF FO>1 THEN C=4:GOSUB 6110:PAIR=TRUE
6070 IF TH>1 THEN C=3:GOSUB 6110:PAIR=TRUE
6080 IF TW>1 THEN C=2:GOSUB 6110:PAIR=TRUE
6090 IF PAIR=FALSE THEN GOTO 6260
6100 GOSUB 6160:RETURN
6110 FOR I=1 TO 5
6120 IF J>5 THEN GOTO 6140
6130 IF (DCD(I)=C OR DCD(I)=C+13 OR DCD(I)=C+26 OR DCD(I)=C+39) THEN Z4(J)=I:J=J+1
6140 NEXT
6150 RETURN
6160 X=1
6170 FOR I=1 TO 5
6180 FOUND=FALSE
6190 FOR J=1 TO 5
6200 IF I=Z4(J) THEN FOUND=TRUE
6210 NEXT
6220 IF X>3 THEN GOTO 6240
6230 IF FOUND=FALSE THEN DSCD(X)=I:X=X+1
6240 NEXT
6250 RETURN
6260 IF DCD(1)<14 AND DCD(2)<14 AND DCD(3)<14 AND DCD(4)<14 AND DCD(5)<14 THEN RETURN
6270 IF (DCD(1)>13 AND DCD(1)<27) AND (DCD(2)>13 AND DCD(2)<27) AND (DCD(3)>13 AND DCD(3)<27) AND (DCD(4)>13 AND DCD(4)<27) AND (DCD(5)>13 AND DCD(5)<27) THEN RETURN
6280 IF (DCD(1)>26 AND DCD(1)<40) AND (DCD(2)>26 AND DCD(2)<40) AND (DCD(3)>26 AND DCD(3)<40) AND (DCD(4)>26 AND DCD(4)<40) AND (DCD(5)>26 AND DCD(5)<40) THEN RETURN
6290 IF DCD(1)>39 AND DCD(2)>39 AND DCD(3)>39 AND DCD(4)>39 AND DCD(5)>39 THEN RETURN
6300 IF (AC=1 AND KI=1 AND QU=1 AND JA=1 AND TE=1) THEN RETURN
6310 IF (KI=1 AND QU=1 AND JA=1 AND TE=1 AND NI=1) THEN RETURN
6320 IF (QU=1 AND JA=1 AND TE=1 AND NI=1 AND EI=1) THEN RETURN
6330 IF (JA=1 AND TE=1 AND NI=1 AND EI=1 AND SE=1) THEN RETURN
6340 IF (TE=1 AND NI=1 AND EI=1 AND SE=1 AND SI=1) THEN RETURN
6350 IF (NI=1 AND EI=1 AND SE=1 AND SI=1 AND FI=1) THEN RETURN
6360 IF (EI=1 AND SE=1 AND SI=1 AND FI=1 AND FO=1) THEN RETURN
6370 IF (SE=1 AND SI=1 AND FI=1 AND FO=1 AND TH=1) THEN RETURN
6380 IF (SI=1 AND FI=1 AND FO=1 AND TH=1 AND TW=1) THEN RETURN
6390 IF (FI=1 AND FO=1 AND TH=1 AND TW=1 AND AC=1) THEN RETURN
6400 CLUB=0:DMD=0:HART=0:SPADE=0
6410 FOR I=1 TO 5
6420 IF DCD(I)<14 THEN SPADE=SPADE+1:GOTO 6460
6430 IF (DCD(I)>13 AND DCD(I)<27) THEN HART=HART+1:GOTO 6460
6440 IF (DCD(I)>26 AND DCD(I)<40) THEN CLUB=CLUB+1:GOTO 6460
6450 DMD=DMD+1
6460 NEXT
6470 IF (SPADE<4 AND HART<4 AND CLUB<4 AND DMD<4) THEN GOTO 6570
6480 IF SPADE=4 THEN C=0:GOTO 6520
6490 IF HART =4 THEN C=13:GOTO 6520
6500 IF CLUB =4 THEN C=26:GOTO 6520
6510 C=39
6520 FOR I=1 TO 5
6530 IF DCD(I)>C AND DCD(I)<C+14 THEN GOTO 6560
6540 DSCD(1)=I:DSCD(2)=0:DSCD(3)=0
6550 RETURN
6560 NEXT
6570 C=0
6580 IF (AC=1 AND KI=1 AND QU=1 AND JA=1) THEN C=1:GOTO 6700
6590 IF (KI=1 AND QU=1 AND JA=1 AND TE=1) THEN C=13:GOTO 6700
6600 IF (QU=1 AND JA=1 AND TE=1 AND NI=1) THEN C=12:GOTO 6700
6610 IF (JA=1 AND TE=1 AND NI=1 AND EI=1) THEN C=11:GOTO 6700
6620 IF (TE=1 AND NI=1 AND EI=1 AND SE=1) THEN C=10:GOTO 6700
6630 IF (NI=1 AND EI=1 AND SE=1 AND SI=1) THEN C=9:GOTO 6700
6640 IF (EI=1 AND SE=1 AND SI=1 AND FI=1) THEN C=8:GOTO 6700
6650 IF (SE=1 AND SI=1 AND FI=1 AND FO=1) THEN C=7:GOTO 6700
6660 IF (SI=1 AND FI=1 AND FO=1 AND TH=1) THEN C=6:GOTO 6700
6670 IF (FI=1 AND FO=1 AND TH=1 AND TW=1) THEN C=5:GOTO 6700
6680 IF (FO=1 AND TH=1 AND TW=1 AND AC=1) THEN C=4:GOTO 6700
6690 GOTO 6800
6700 FOR J=1 TO 4
6710 TST=FALSE
6720 FOR I=1 TO 5
6730 IF TST=TRUE THEN GOTO 6750
6740 IF (DCD(I)=C OR DCD(I)=C+13 OR DCD(I)=C+26 OR DCD(I)=C+39) THEN Z4(J)=I:TST=TRUE
6750 NEXT
6760 IF C=1 THEN C=14
6770 C=C-1
6780 NEXT
6790 GOSUB 6160:RETURN
6800 FOR I=1 TO 5
6810	CRD2(I)=DCD(I)
6820 IF (DCD(I)>13 AND DCD(I)<27) THEN CRD2(I)=DCD(I)-13
6830 IF (DCD(I)>26 AND DCD(I)<40) THEN CRD2(I)=DCD(I)-26
6840 IF DCD(I)>39 THEN CRD2(I)=DCD(I)-39
6850 IF CRD2(I)=1 THEN CRD2(I)=14
6860 NEXT
6870 HICRD(1)=CRD2(1):C=1
6880 FOR I=2 TO 5
6890 IF HICRD(1)<CRD2(I) THEN HICRD(1)=CRD2(I):C=I
6900 NEXT
6910 Z4(1)=C
6920 IF C=1 THEN HICRD(2)=CRD2(2):C=2 ELSE C=1:HICRD(2)=CRD2(1)
6930 FOR I=1 TO 5
6940 IF I=Z4(1) THEN GOTO 6960
6950 IF HICRD(2)<CRD2(I) THEN HICRD(2)=CRD2(I):C=I
6960 NEXT
6970 Z4(2)=C:Z4(3)=0:Z4(4)=0:Z4(5)=0
6980 GOSUB 6160
6990 RETURN
7000 GOSUB 8570:GOSUB 8550
7010 LOCATE 23,1:COLOR SC
7020 PRINT NAM$(CURRENT)", apueste (Placa de 10$ min:";
7030 LOCATE 24,1,1:PRINT "tipee M para min,F p/pasar)? ";
7040 LOCATE 24,32:COLOR TI:PRINT "        ";:LOCATE 24,32,1:GOSUB 7430
7050 IF STARTOVER=1 THEN 7040
7060 IF RID=1 THEN PFOLD=TRUE:RETURN
7070 IF NUM<10 THEN LOCATE 25,3,0:COLOR TI:SOUND 400,4:PRINT NAM$(CURRENT)", la placa min es de 10$.";:FOR I=1 TO 3000:NEXT:GOSUB 8530:GOTO 7040
7080 IF NUM>PLAYER(CURRENT) THEN LOCATE 25,3,0:COLOR TI:SOUND 400,4:PRINT NAM$(CURRENT)", ud solo tiene $";:VALU=PLAYER(CURRENT):GOSUB 8500:PRINT A$".";:FOR I=1 TO 3000:NEXT:GOSUB 8530:GOTO 7040
7090 BET=NUM+BET
7100 AMO=AMO+NUM:GOSUB 7760:PLAYER(CURRENT)=PLAYER(CURRENT)-NUM:GOSUB 8380
7110 CT=0:FOR I=1 TO 5:CRD(I)=DCD(I):NEXT:GOSUB 2160
7120 GOSUB 8570:GOSUB 8550:GOTO 8610
7130 DFOLD=TRUE:COLOR TI:LOCATE 14,12:PRINT "ME FUI":BET=BET-NUM:PLAYER(CURRENT)=PLAYER(CURRENT)+NUM:RETURN
7140 LOCATE 6,1:COLOR TI:PRINT "Veo su apuesta y habla usted.           ":AMO=AMO+NUM:GOSUB 7760:RETURN
7150 LOCATE 6,1:COLOR TI:PRINT "Veo su apuesta e incremento en  $";:VALU=BET2:GOSUB 8500:PRINT A$"."
7160 AMO=AMO+BET2+NUM:GOSUB 7760
7170 FOR I=1 TO 3000:NEXT
7180 GOSUB 8570:GOSUB 8550
7190 COLOR SC:LOCATE 23,1:PRINT "Que hace usted ahora  ";
7200 LOCATE 24,1:PRINT "(F=Pasa C=Ve      R=Levanta )? ";
7210 LOCATE 24,32:COLOR TI:PRINT "       ";:LOCATE 24,32,1
7220 Z2$=INKEY$:IF Z2$<>"" THEN 7220
7230 Z2$=INKEY$:IF Z2$=""  THEN 7230
7240 IF Z2$="F" OR Z2$="f" THEN PRINT Z2$;:PFOLD=TRUE:RETURN
7250 IF Z2$="C" OR Z2$="c" THEN PRINT Z2$;:BET=BET+BET2:AMO=AMO+BET2:GOSUB 7760:PLAYER(CURRENT)=PLAYER(CURRENT)-BET2:GOSUB 8380:RETURN
7260 IF Z2$<>"r" AND Z2$<>"R" THEN SOUND 400,4:GOTO 7230
7270 PRINT Z2$;
7280 AMO=AMO+BET2:GOSUB 7760:BET=BET+BET2:PLAYER(CURRENT)=PLAYER(CURRENT)-BET2:GOSUB 8380
7290 GOSUB 8570:GOSUB 8550:GOSUB 8530
7300 COLOR SC:LOCATE 23,1:PRINT "En cuanto desea alzar la apuesta (Tipee";
7310 LOCATE 24,1:PRINT "M p/Placa de 10$, F p/pasar)? ";
7320 LOCATE 24,32:COLOR TI:PRINT "        ";:LOCATE 24,32,1
7330 GOSUB 7430
7340 IF STARTOVER=1 THEN 7320
7350 IF RID=1 THEN PFOLD=TRUE:RETURN
7360 IF FSTBET=1 AND NUM+10>PLAYER(CURRENT) THEN BET2=NUM:GOSUB 9060:GOTO 7290
7370 IF NUM<10 THEN LOCATE 25,1,0:COLOR TI:SOUND 400,4:PRINT "  "NAM$(CURRENT)", la Placa minima es de 10$.";:FOR I=1 TO 3000:NEXT:GOSUB 8530:GOTO 7320
7380 IF NUM>PLAYER(CURRENT) THEN LOCATE 25,1,0:COLOR TI:SOUND 400,4:PRINT "  "NAM$(CURRENT)", Ud solo tiene $";:VALU=PLAYER(CURRENT):GOSUB 8500:PRINT A$".";:FOR I=1 TO 3000:NEXT:GOSUB 8530:GOTO 7320
7390 BET=NUM+BET
7400 AMO=AMO+NUM:GOSUB 7760:PLAYER(CURRENT)=PLAYER(CURRENT)-NUM:GOSUB 8380
7410 GOSUB 8570:GOSUB 8550:FOR JK=1 TO 1000:NEXT JK:GOTO 7140
7420 RETURN
7430 NUM=0
7440 STARTOVER=0
7450 RID=0
7460 COLOR TI
7470 BET$=INKEY$:IF BET$<>"" THEN 7470
7480 BET$=INKEY$:IF BET$=""  THEN 7480
7490 IF BET$=CHR$(13) THEN IF NUM=0 THEN 7540 ELSE RETURN
7500 IF BET$="M" OR BET$="m" THEN IF NUM>0 THEN 7540 ELSE NUM=10:PRINT "10";:RETURN
7510 IF BET$="F" OR BET$="f" THEN RID=1:RETURN
7520 IF ASC(BET$)=8 OR BET$=CHR$(0)+CHR$(75) THEN IF NUM=0 THEN 7540 ELSE W=POS(0):LOCATE 24,W-1,0:NUM=INT(NUM/10):PRINT " ";:LOCATE 24,W-1,1:GOTO 7480
7530 IF BET$>="0" AND BET$<="9" THEN 7550
7540 SOUND 400,4:GOTO 7480
7550 NUMBER=VAL(BET$)
7560 IF NUMBER=0 THEN IF NUM=0 THEN 7540
7570 IF NUM*10+NUMBER>999999! THEN LOCATE 25,1:SOUND 400,4:PRINT "Apueste de nuevo, "NAM$(CURRENT)".";:FOR I=1 TO 2500:NEXT:GOSUB 8530:LOCATE 23,1:STARTOVER=1:RETURN
7580 NUM=NUM*10+NUMBER:PRINT BET$;:GOTO 7480
7590 AC=0:KI=0:QU=0:JA=0:TE=0:NI=0:EI=0:SE=0:SI=0:FI=0:FO=0:TH=0:TW=0
7600 FOR I=1 TO 5
7610 IF (CRD(I)=1 OR CRD(I)=14 OR CRD(I)=27 OR CRD(I)=40) THEN AC=AC+1
7620 IF (CRD(I)=13 OR CRD(I)=26 OR CRD(I)=39 OR CRD(I)=52) THEN KI=KI+1
7630 IF (CRD(I)=12 OR CRD(I)=25 OR CRD(I)=38 OR CRD(I)=51) THEN QU=QU+1
7640 IF (CRD(I)=11 OR CRD(I)=24 OR CRD(I)=37 OR CRD(I)=50) THEN JA=JA+1
7650 IF (CRD(I)=10 OR CRD(I)=23 OR CRD(I)=36 OR CRD(I)=49) THEN TE=TE+1
7660 IF (CRD(I)=9 OR CRD(I)=22 OR CRD(I)=35 OR CRD(I)=48) THEN NI=NI+1
7670 IF (CRD(I)=8 OR CRD(I)=21 OR CRD(I)=34 OR CRD(I)=47) THEN EI=EI+1
7680 IF (CRD(I)=7 OR CRD(I)=20 OR CRD(I)=33 OR CRD(I)=46) THEN SE=SE+1
7690 IF (CRD(I)=6 OR CRD(I)=19 OR CRD(I)=32 OR CRD(I)=45) THEN SI=SI+1
7700 IF (CRD(I)=5 OR CRD(I)=18 OR CRD(I)=31 OR CRD(I)=44) THEN FI=FI+1
7710 IF (CRD(I)=4 OR CRD(I)=17 OR CRD(I)=30 OR CRD(I)=43) THEN FO=FO+1
7720 IF (CRD(I)=3 OR CRD(I)=16 OR CRD(I)=29 OR CRD(I)=42) THEN TH=TH+1
7730 IF (CRD(I)=2 OR CRD(I)=15 OR CRD(I)=28 OR CRD(I)=41) THEN TW=TW+1
7740 NEXT
7750 RETURN
7760 COLOR TI:LOCATE 4,24,0:PRINT "Pozo: $";:VALU=AMO:GOSUB 8500:PRINT A$
7770 RETURN
7780 COLOR TI
7790 LOCATE ,,1
7800 MANY=0
7810 FIRST=POS(0)
7820 Z2$=INKEY$:IF Z2$<>"" THEN 7820
7830 Z2$=INKEY$:IF Z2$=""  THEN 7830
7840 IF Z2$=CHR$(13) THEN 8000
7850 DUM$=Z2$:GOSUB 8050
7860 IF DELIM<>1 THEN 7880
7870 IF Z3(1)=0 THEN 7990 ELSE DUM$=RIGHT$(LAST$,1):GOSUB 8050:IF DELIM=0 THEN PRINT Z2$;:LAST$=LAST$+Z2$:GOTO 7830 ELSE GOTO 7990
7880 IF Z2$<>CHR$(0)+CHR$(75) AND Z2$<>CHR$(8) THEN 7910
7890 IF POS(0)=FIRST THEN 7990 ELSE W=POS(0):LOCATE 24,W-1,0:PRINT " ";:LOCATE 24,W-1,1
7900 IF RIGHT$(LAST$,1)>CHR$(48) AND RIGHT$(LAST$,1)<CHR$(54) THEN MANY=MANY-1:LAST$=LEFT$(LAST$,LEN(LAST$)-1):GOTO 7830 ELSE LAST$=LEFT$(LAST$,LEN(LAST$)-1):GOTO 7830
7910 IF Z2$<CHR$(49) OR Z2$>CHR$(53) THEN 7990
7920 IF MANY=0 THEN MANY=MANY+1:Z3(MANY)=VAL(Z2$):GOTO 7980
7930 IF MANY+1>3 THEN 7990
7940 FOR I=1 TO MANY
7950 IF Z3(I)=VAL(Z2$) THEN 7990
7960 NEXT
7970 MANY=MANY+1:Z3(MANY)=VAL(Z2$)
7980 PRINT Z2$;:LAST$=LAST$+Z2$:GOTO 7830
7990 SOUND 400,4:GOTO 7830
8000 IF MANY=1 THEN C=Z3(1):RETURN
8010 IF MANY=2 THEN C=Z3(1):C2=Z3(2):RETURN
8020 IF MANY=3 THEN C=Z3(1):C2=Z3(2):C3=Z3(3):RETURN
8030 LOCATE ,,0:PRINT "Nada";
8040 RETURN
8050 IF DUM$=CHR$(39) OR DUM$=CHR$(44) OR DUM$=CHR$(32) OR DUM$=CHR$(45) OR DUM$=CHR$(47) OR DUM$=CHR$(58) OR DUM$=CHR$(59) OR DUM$=CHR$(96) THEN DELIM=1 ELSE DELIM=0
8060 RETURN
8070 IF TOTLD<>126 AND TOTLD>12 THEN 8120
8080 FOR J=1 TO 5
8090 IF TIEP(J)<>TIED(J) THEN TOTLD=TIED(J):TOTLP=TIEP(J):RETURN
8100 NEXT
8110 RETURN
8120 IF TOTLD>103 OR TOTLD<26 THEN 8140
8130 TOTLD=TIED(5):TOTLP=TIEP(5):RETURN
8140 IF TOTLD>25 OR TOTLD<13 THEN RETURN
8150 FOR J=3 TO 5
8160 IF TIEP(J)<>TIED(J) THEN TOTLD=TIED(J):TOTLP=TIEP(J):RETURN
8170 NEXT
8180 RETURN
8190 IF HAND<>304 THEN 8210
8200 LOCATE X,31,0:PRINT "ESCALERA ";:LOCATE X+1,31,0:PRINT "  REAL ";:RETURN
8210 IF HAND<295.5 THEN 8230
8220 LOCATE X,31,0:PRINT "ESCALERA  ";:LOCATE X+1,31,0:PRINT "de COLOR";:RETURN
8230 IF HAND<283 THEN 8250
8240 LOCATE X,31,0:PRINT " POKER   ";:LOCATE X+1,31,0:PRINT "        ";:RETURN
8250 IF HAND<127 THEN 8270
8260 LOCATE X,31,0:PRINT "  FULL  ";:LOCATE X+1,31,0:PRINT "       ";:RETURN
8270 IF HAND<>126 THEN 8290
8280 LOCATE X,31,0:PRINT " COLOR   ";:RETURN
8290 IF HAND<116.5 THEN 8310
8300 LOCATE X,31,0:PRINT "ESCALERA  ";:RETURN
8310 IF HAND<104 THEN 8330
8320 LOCATE X,31,0:PRINT " PIERNA  ";:LOCATE X+1,31,0:PRINT "        ";:RETURN
8330 IF HAND<26 THEN 8350
8340 LOCATE X,31,0:PRINT "PAR DOBLE ";:RETURN
8350 IF HAND<13 THEN 8370
8360 LOCATE X,31,0:PRINT "PAR SIMPLE";:RETURN
8370 LOCATE X,31,0:PRINT "    NADA,";:LOCATE X+1,31,0:PRINT "solo una  ";:LOCATE X+2,31,0:PRINT "carta alta";:RETURN
8380 ON PEOPLE GOTO 8390,8400,8410,8420
8390 ST=17:SKIP=0:GOTO 8430
8400 ST=9:SKIP=16:GOTO 8430
8410 ST=5:SKIP=12:GOTO 8430
8420 ST=2:SKIP=10
8430 COLOR BG:LOCATE 1,1,0:PRINT SPACE$(40):LOCATE 2,1,0:PRINT SPACE$(40)
8440 FOR I=1 TO PEOPLE
8450 LOCATE 1,ST,0:IF CURRENT=I THEN COLOR SC ELSE COLOR PM
8460 PRINT NAM$(I)
8470 LOCATE 2,ST,0:VALU=PLAYER(I):GOSUB 8500:PRINT "$"A$:ST=ST+SKIP
8480 NEXT
8490 RETURN
8500 A$=STR$(VALU)
8510 A$=RIGHT$(A$,LEN(A$)-1)
8520 RETURN
8530 COLOR BG:LOCATE 25,1:PRINT SPACE$(39);
8540 RETURN
8550 COLOR BG:LOCATE 24,1:PRINT SPACE$(39);
8560 RETURN
8570 COLOR BG:LOCATE 23,1:PRINT SPACE$(40);
8580 RETURN
8590 COLOR BG:LOCATE 15,1:PRINT SPACE$(40):LOCATE 16,1:PRINT SPACE$(40)
8600 RETURN
8610 FSTBET=0
8620 IF CT>282 THEN BET2=BET:GOTO 9030
8630 IF CT>125 AND MANY<2 GOTO 9020
8640 IF MANY=0 THEN N1=N1+1:IF N1=3 THEN N1=0:GOTO 7140
8650 IF CT>125 AND MANY>1 THEN BET2=BET:GOTO 9030
8660 IF CT>116 AND NUM>.5*BET AND MANY<2 GOTO 7140
8670 IF CT>116 AND NUM<.5*BET AND MANY<2 THEN BET2=(BET-NUM):GOTO 9030
8680 IF CT>116 AND NUM>.5*BET AND MANY=3 THEN BET2=NUM:GOTO 9030
8690 IF CT>116 AND NUM>.5*BET AND MANY=2 THEN BET2=INT(.5*BET):GOTO 9030
8700 IF CT>116 AND NUM<.5*BET AND MANY>1 THEN BET2=INT(.4*BET):GOTO 9030
8710 IF CT>103 AND NUM<.5*BET AND MANY>0 THEN BET2=INT(.4*BET):GOTO 9030
8720 IF CT>103 AND NUM>.5*BET AND MANY>1 THEN BET2=INT(.4*BET):GOTO 9030
8730 IF CT>103 AND NUM>.5*BET AND MANY<2 THEN GOTO 7140
8740 IF CT>25 AND NUM<.5*BET  AND MANY=3 THEN BET2=INT(.4*BET):GOTO 9030
8750 IF CT>25 AND NUM<.5*BET  AND MANY=2 THEN BET2=INT(.33*BET):GOTO 9030
8760 IF CT>25 AND NUM< .5*BET AND MANY>2 THEN GOTO 7140
8770 IF CT>25 AND NUM>20 AND NUM<.5*BET AND MANY<3 AND MANY>0 THEN 7140
8780 RN1=INT(RND*10)+1:IF RN1=7 THEN BET2=INT(.5*BET):GOTO 9030
8790 IF CT>25 AND NUM>20 AND NUM>.5*BET AND MANY<3 THEN 7130
8800 IF CT>25 AND NUM>20 AND MANY=3 THEN 7140
8810 IF CT>20 AND NUM<.3*PLAYER(CURRENT) AND MANY>0 THEN 7140
8820 IF CT>20 AND NUM<21 AND BET>50 AND MANY=0 THEN 7140
8830 IF CT>20 AND NUM>20 AND NUM<.5*BET AND MANY>0 THEN 7140
8840 IF CT >20 AND NUM >.5*BET AND NUM>.3*PLAYER(CURRENT) THEN GOTO 7130
8850 IF CT>12 AND NUM<21 AND MANY>0 THEN 7140
8860 IF CT>12 AND NUM>20 AND NUM<.5*BET AND MANY=3 THEN 7140
8870 IF CT>10 AND NUM<20 AND MANY>0 GOTO 7140
8880  GOTO 7130
8890 IF CT<10 AND BET>50 GOTO 840
8900 FSTBET=1
8910 BET3=BET2
8920 IF CT>115 THEN BET2=BET:GOTO 8990
8930 IF CT>104 THEN BET2=INT(BET*.8):GOTO 8990
8940 IF CT>90  THEN BET2=INT(BET*.6):GOTO 8990
8950 IF CT>26  THEN BET2=INT(BET*.5):GOTO 8990
8960 IF CT>20  THEN BET2=INT(BET*.4):GOTO 8990
8970 IF CT<15  AND BET>PLAYER(CURRENT)	THEN GOTO 840
8980 GOTO 860
8990 IF BET2+20>PLAYER(CURRENT) THEN BET2=PLAYER(CURRENT)-20
9000 IF BET2<10 THEN BET2=BET3:GOTO 860
9010 GOSUB 7150:IF PFOLD=TRUE THEN 1140 ELSE 870
9020 BET2=INT(.5*BET)
9030 IF BET2+10> PLAYER(CURRENT) THEN BET2=PLAYER(CURRENT)-10
9040 IF BET2>9 THEN 7150 ELSE GOTO 7140
9060 LOCATE 23,1,0:COLOR TI:SOUND 400,4:PRINT NAM$(CURRENT)", si ud juega $";:VALU=BET2:GOSUB 8500:PRINT A$", no tendra";:PRINT SPACE$(15-(LEN(A$)+LEN(NAM$(CURRENT))));:LOCATE 24,1,0:PRINT "el minimo de 10$, para su proxima apues";
9070 LOCATE 25,1,0:PRINT "ta.  ";:COLOR PM:PRINT "    Pres. "+CHR$(17)+CHR$(196)+CHR$(217)+" p/continuar.";
9080 Z2$=INKEY$:IF Z2$<>"" THEN 9080
9090 Z2$=INKEY$:IF Z2$=""  THEN 9090
9100 IF Z2$<>CHR$(13) THEN SOUND 400,4:GOTO 9090
9110 RETURN
9999 SAVE"pokemar1":PRINT "Pokemar1.bas Rescatado":END
